home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
YERK
/
SUPPLEME
/
UNSUPPOR
/
OPTIONAL
/
3DARRAY
< prev
next >
Wrap
Text File
|
1986-01-22
|
1KB
|
62 lines
\ 3 Dimensional Array
\ 1/07/85 cdn Logical extension to 2dArray
:CLASS 3dArray <Super 2dArray 4 <Indexed
Int xbnd
\ ( xbnd -- ) Store x bound; y & z bound already used by super 2dArray
:M CLASSINIT: classinit: super put: xbnd ;M
\ ( -- ) Allocate arrays for third dimension
:M NEW:
new: super
ylimit: super 0
DO
xlimit: super 0
DO
get: xbnd heap> array i j to: super
LOOP
LOOP
;M
\ ( val x y z -- )
:M TO: to: [ at: super ] ;M
\ ( x y z -- )
:M AT: at: [ at: super ] ;M
\ ( -- ) Deallocate array space in heap
:M DISPOSE:
ylimit: super 0
DO
xlimit: super 0
DO
i j at: super killptr
LOOP
LOOP
dispose: super
;M
:M XLIMIT: get: xbnd ;M
:M YLIMIT: xlimit: super ;M
:M ZLIMIT: ylimit: super ;M
:M PRINT: { \ k -- }
zlimit: self 0
DO CR ." layer:" i . CR
i -> k
ylimit: self 0
DO CR
xlimit: self 0
DO
i j k at: self .
LOOP
LOOP
LOOP
;M
;CLASS